Forum Discussion
Measure with IF function between 2 reports
Hello,
I have created a measure between 2 different report in Power BI. The measure based on If function. as you can see on the blow I'd like to count spike and none-spike orders. but the problem is I can see any order if it is spike or none but when it comes to count number of spike and none spike orders I can see total number of orders under spike.
my formula is :
Can you help me to solve this problem ?
Thanks in advance.
Baris
Hi again,
I have now sendt you an updated model.
What I did as agreed was to create a new calculated table:Calculated table = --You can change this to the name you want of the tableVAR __VTable =SUMMARIZE (Sheet1,Sheet1[ORDER_NO],"Balance Qty", SUM ( Sheet1[BALANCE QTY] ),"Maximum order quantity", SUM ( PMD[Maximum order quantity] ))VAR __Result =ADDCOLUMNS (__VTable,"Measure",IF ([Maximum order quantity] < [Balance Qty],"Spikes", --This you can change to what you wantIF ([Maximum order quantity] > [Balance Qty],"None spikes", --This you can change to what you wantBLANK ())))RETURN__Result
Then you can just create a new measure counting:Rows = --this can be changed to what you wnatCOUNTROWS( 'Calculated table' )
If you found my post valuable, please give me a Kudos and click 'Accept solution' button π
Br
Marius
16 Replies
- mariussve1Solution Sage
Hi,
When you use if and the last argument (or any argument) is a string: "None" you will not get a total. Totals only works on numeric values.
Marius π
- AnonymousNot applicable
Hello Marius,
you mean this:
Thanks
Baris
- AnonymousNot applicable
Hi
I have changed the strings ones to numeric one which you can see above. but still can not see totals.
Thanks
Baris
- AnonymousNot applicable
Hello,
But still I can not see the number of the orders. I mean howmany of them spike or none ?
Thank you
Baris
- mariussve1Solution Sage
Hi again,
Can you please check if you have turned off totals in settings for the table?
If not, could you please share a test pbix file with me somewhere?
Marius π
- AnonymousNot applicable
Hi,
actually I did not turned it off. I will appreciate if you share your pbix file in any way?
Thank you
Baris
- mariussve1Solution Sage
It would be better if you could please share me a example file? Then I can edit the measure and send it back to you. Else I need to create a example model, and I dont have all the details.
Do you have dropbox, onedrive or something? If so, please send me a DM and I will look into it for you π
BrMarius
- mariussve1Solution Sage
It is possible to do this with two measures also if you like that better than calculated table.
But when it comes to dimensions lile this i think its best to use calculated table.
The calculated table is, however, dependent on the other two and the relationship between them to function.
Marius π