locked
Need DAX formula for Tabular Model RRS feed

  • Question

  • Hello All i am new to Power BI 

    I need DAX formula for Tabular Model . kIndly help me

     Select  Count(Distinct(A.Code)) [No_District]    FROM TBL  A 
      Left Join State S
      ON A.OLDYEAR = S.OLDYEAR and A.YEAR = S.YEAR 
      AND  A.StateKey = S.StateKey 
      where S.Status=1  

      ----------------[No. of States with Pending Initial Report] Infobox --------------
      Select  Count(Distinct(A.StateCode)) [No. of States with Pending Initial Report] 
      FROM TBL 
      A   where FLAG = 'No'

        -----------------[Status of Initial Report] Pie Chart -------------
      Select Count(distinct(statecode))  [No Of States]  ,[FLAG] [Status]
      FROM TBL
      Group by [FLAG]


    Abhishek Parihar BI Consultant (Please mark the post as answered if it answers your question)

    Thursday, June 29, 2017 2:20 PM

Answers

  • Hi Abhishek,

    Thanks for your question.

    According to your description, you want to apply the distinct count calculation to any columns in any tables in the data model, and filter only those values related to events filtered in another table, right?

    In this scenario, please refer to below blog:
    http://www.daxpatterns.com/distinct-count/

    One more thing to mention,your problem is more related to PowerBI. Since our forum is discussing POWER PIVOT issue, To solve your question more efficiently, please post your question in PowerBI forum: http://community.powerbi.com ,you will get a more professional support from there, thank you for your understanding and support.


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, June 30, 2017 1:53 AM

All replies

  • Hi Abhishek,

    Thanks for your question.

    According to your description, you want to apply the distinct count calculation to any columns in any tables in the data model, and filter only those values related to events filtered in another table, right?

    In this scenario, please refer to below blog:
    http://www.daxpatterns.com/distinct-count/

    One more thing to mention,your problem is more related to PowerBI. Since our forum is discussing POWER PIVOT issue, To solve your question more efficiently, please post your question in PowerBI forum: http://community.powerbi.com ,you will get a more professional support from there, thank you for your understanding and support.


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, June 30, 2017 1:53 AM
  • thanks you sir I already reported this issue on power BI community forum. 


    Abhishek Parihar BI Consultant (Please mark the post as answered if it answers your question)

    Friday, June 30, 2017 7:13 AM